﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace StaticSample
{
    public class Marker
    {
        #region Instance Variables/Fields

        private int inkLevel;

        #endregion

        #region Properties
        public string Shape { get; private set; }
        public string Color { get; private set; }
        public bool IsErasebleInk { get; private set; }
        public bool HasCap { get; set; }
        public MarkerBrand Brand { get; set; }
        
        #endregion

        #region Constructors

        public Marker(string shape, string color, bool isErasebleInk, bool hasCap, MarkerBrand brand)
        {
            Shape = shape;
            Color = color;
            IsErasebleInk = isErasebleInk;
            HasCap = hasCap;
            Brand = brand;
            inkLevel = 100;
        }

        #endregion

        #region Methods
        public string Write(string message)
        {            
            if (inkLevel == 0)
            {
                return @"Sorry, this marker is empty now you 
                        might as well throw me away and get some peanut butter booohooo :(";
            }

            if (HasCap == true)
            {
                return @"Sorry, you need to remove the cap to start writing";
            }

            inkLevel = inkLevel - 10;
            string finalMessage = "The message you gave this marker '" + message + @"' is 
                                    being written in " + Color + @" ink and the ink 
                                    level is now at " + inkLevel.ToString();
            return finalMessage;
        }

        #endregion

        public static Marker MakeGreenExpoMarker()
        {
            return new Marker("cylinder", GREEN, true, true, MarkerBrand.Expo);
        }

        public static Marker MakeRedBicMarker()
        {
            return new Marker("cylinder", RED, true, true, MarkerBrand.Bic);
        }

        //Enum for the available brands
        public enum MarkerBrand
        {
            Expo,
            Sharpie,
            Bic,
            PaperMate
        }

        //Constants
        public const string BLACK = "black";
        public const string RED = "red";
        public const string GREEN = "green";

        //Static variable
        public static bool isWritable = true;
    }
}
